<form class="layui-form search-form" lay-filter="builder-search-form">
    <div class="vessel">
        <div class="container layui-row layui-col-space5">
            {foreach name="search_items" item="vo" key='key'}
            <div class="layui-col-xs12 layui-col-sm6 layui-col-md3 layui-col-lg2 item">
                {switch vo.type}

                {case value="input"}
                <input type="text" name="{$vo.field}" placeholder="{$vo.title}" class="layui-input"
                       value="<?php echo request()->get($vo['field']);?>" autocomplete="off">
                {/case}

                {case value="select"}
                <select name="{$vo.field}" lay-search="{caseSensitive:false, fuzzy: true}">
                    <option value="">{$vo.title}</option>
                    {foreach name="vo.optionValue" key="key" item="option"}
                    <option value="{$key}">{$option}</option>
                    {/foreach}
                </select>
                {/case}

                {case value="linkage"}
                <div class="linkage">
                    <input type="text" placeholder="{$vo.title}"
                           data-field="{$vo.field}"
                           data-url="{$vo.linkageUrl}"
                           class="layui-input lay-search-linkage"
                           id="lay-search-linkage-{$vo.field}"
                           value="<?php echo request()->get($vo['field']);?>" autocomplete="off" readonly>
                </div>
                {/case}

                {case value="date"}
                <input class="layui-input lay-search-date" data-type="{$vo.dateType}"
                       data-range="{$vo.dateRange?'true':'false'}"
                       placeholder="{$vo.title}" name="{$vo.field}"
                       value="<?php echo request()->get($vo['field']);?>" autocomplete="off" readonly/>
                {/case}

                {case value="selectGroup"}
                <select name="{$vo.field}">
                    <option value="">{$vo.title}</option>
                    {foreach name="vo.optionGroupValue" key="key" item="co"}
                    <optgroup label="{$co.title}">
                        {foreach name="$co.child" item="tt"}
                        <option value="{$tt.value}">{$tt.title}</option>
                        {/foreach}
                    </optgroup>
                    {/foreach}
                </select>
                {/case}

                {/switch}
            </div>
            {/foreach}
        </div>
        <div class="btn">
            <div type="button" class="layui-btn layui-btn-sm" builder-search-event="search">搜索</div>
            <button type="reset" class="builder-reset layui-btn layui-btn-sm layui-btn-danger layui-hide"
                    builder-search-event="clear">重置
            </button>
        </div>
    </div>
    {if !empty($search_tab_items)}
    <div class="layui-row layui-col-space5 search-tab">
        {foreach name="$search_tab_items" item="vo"}
        <div class="chunk flex items-center layui-col-xs12">
            <div class="title">{$vo.title}</div>
            <div class="full flex items-center">
                {foreach name="$vo.optionValue" key="key" item="option"}
                <div class="item">
                    <input type="{$vo.type}" name="{$vo.field}{$vo.type == 'checkbox'?'[]':''}" value="{$key}"
                           lay-skin="none">
                    <div lay-{$vo.type} class="layui-badge">{$option}</div>
                </div>
                {/foreach}
            </div>
        </div>
        {/foreach}
    </div>
    {/if}
</form>